package com.leoman.resource.service;

import com.leoman.common.service.GenericManager;
import com.leoman.resources.entity.MusicResource;
import com.leoman.resources.entity.StillResource;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * Created by 蔡琦 on 2016/6/28 0028.
 *
 */
public interface MusicService extends GenericManager<MusicResource>{

    // 音乐资源列表（分页）
    Page<MusicResource> page(Integer pageNum, Integer pageSize);

    // 删除音乐
    Integer deleteMusic(Long musicId);

    // 保存音乐
    Integer saveMusic(Long categoryId,
                             String name,
                             String singer,
                             @RequestParam(value = "imageFile", required = false) MultipartFile file) throws IOException;

    // 根据分类id查询对应的音乐资源列表
    List<MusicResource> findByCategoryId(Long categoryId);

}
